/**************************************************************************************
*
*	Copyright (C) 2010 - 2012 Brent Andrew O. Chua - See LICENSE.txt for more info.
*		
*	Filename	- AsyncLoadResource.h
*
*	Description - 
*
*	Comments	- 
*
*	Modification History:
*			Name			   Date					Description
*			MrCodeSushi	-	08/15/2012	-	Creation of this file.
**************************************************************************************/
#ifndef _PSX_ASYNC_LOAD_RESOURCE_H_
#define _PSX_ASYNC_LOAD_RESOURCE_H_

#include "PulseSTD.h"
#include "ThreadTask.h"

namespace Pulse
{
	// This adapter is used for AsyncLoadResource
	class AdapterResourceLoader
	{
	public:
		
		AdapterResourceLoader( void ) { }

		virtual ~AdapterResourceLoader( void ) { }

		virtual BOOL Run( TaskStatus *pTaskStatus ) = 0 { return TRUE; }

	};

	class AsyncLoadResource : public ThreadTask
	{
	public:

		AsyncLoadResource( void ) 
			: m_pLoader( PSX_NULL )
		{
		}

		AsyncLoadResource( AdapterResourceLoader *pLoader );

		virtual ~AsyncLoadResource( void );

		void SetResourceToLoad( AdapterResourceLoader *pLoader );

		virtual BOOL Run( void );

	private:

		AdapterResourceLoader *m_pLoader;
	};
}

#endif /* _PSX_ASYNC_LOAD_RESOURCE_H_ */